package cn.two.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.two.dao.IOaNewsDao;
import cn.two.model.OaNews;




@Service("newsService")
public class NewsService implements IOaNewsDao {

	@Resource
	private IOaNewsDao newsDao;
    
	
	public OaNews selectNewsById(int newsId) {
		 
		return newsDao.selectNewsById(newsId);
	}

	
   
	public int addNews(OaNews news) {
		 
		return newsDao.addNews(news);
	}
    
	public int delNews(int id) {
		 
		return newsDao.delNews(id);
	}
    
	
	public OaNews updateNews(OaNews oaNews) {
		 
		return newsDao.updateNews(oaNews);
	}
    
	
	public int getTotalCount() {
		
		return newsDao.getTotalCount();
	}
    
	
	public List getNewsByPage(OaNews oaNews) {
		
		return newsDao.getNewsByPage(oaNews);
	}
    
	public int getTotalPages(int count, int pageSize) {
		
		return (count%pageSize==0)?count/pageSize:count/pageSize+1;
	}


	public int getTotalCountByJointQuery(OaNews oaNews) {		
		return newsDao.getTotalCountByJointQuery(oaNews);
	}




	
	

	


	

	

}
